package Java1227;
//this是当前类的对象 和 super
//super表示父类的引用。
class J {
    int X = 2;
    public class I extends J {
        int X =3;
        void m(){
            //会打印3
            System.out.println(this.X);
            System.out.println(super.X);
        }

    }
}

public class I {
    public static void main(String[] args) {
        I a = new I();

    }
    String name;
    int age;

    public I() {
    }

    public I(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "I{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
